<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<link rel="stylesheet" href="{yun:}$config.sy_weburl{/yun}/app/template/wap/hb/reset.css?v={yun:}$config.cachecode{/yun}" type="text/css" />
	<script>
		window.onerror=function(){return true;}
	</script>
	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
	<script type="text/javascript">
		if (navigator.userAgent.indexOf('AlipayClient') > -1) {
			document.writeln('<script src="https://appx/web-view.min.js"' + '>' + '<' + '/' + 'script>');
		}
	</script>
	<script type="text/javascript" src="https://b.bdstatic.com/searchbox/icms/searchbox/js/swan-1.7.0.js"></script>
	<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
</head>

<body>
	<div class="hb_jobbox4">
    	<div class="hb_jobbox4cont">
			{yun:}foreach item=v from=$jobs key=key{/yun} 
				{yun:}if $key<3{/yun}
					<div class="hb_jobbox4list">
						<div class="hb_jobbox4list_jobname"> {yun:}$v.name{/yun}</div>
                        <div class="hb_jobbox4list_p"> 薪资待遇：{yun:}$v.job_salary{/yun}</div>
						<div class="hb_jobbox4list_p hb_jobbox4list_pyq">岗位要求：年龄{yun:}$comclass_name[$v.age]{/yun}，{yun:}$comclass_name[$v.edu]{/yun}学历，{yun:}$comclass_name[$v.exp]{/yun}经验</div>
						
					</div>
				{yun:}/if{/yun}
			{yun:}/foreach{/yun}               
		</div>
    	<div class="hb4_webname">{yun:}$config.sy_webname{/yun} ({yun:}$config.sy_weburl{/yun})</div>
		<div class="hb_jobbox4comname">{yun:}$comname{/yun}</div>
		<div class="hb4_ewm"><img src="{yun:}url m=wap c=ajax a=pubqrcode toc=company toa=show toid=$smarty.get.id{/yun}" width="150" height="150" /></div>
	</div>
	
	<div class="hb_generate" style="display:none;" id="hb_a">
		<a href='javascript:void(0);' onclick="getHbJob({yun:}$smarty.get.id{/yun});" class='hb_generate_bth'>选择职位生成海报</a>
	</div>
	<div id="hbtip" class="hb_show_tip" style="display: none"></div>	
 	<!-- 职位弹出样式 -->

	<div class="hb_jobchosebox" style='display:none;' id='jobList'>
		<div class="hb_jobchosebox_h1">
			请选择需要在海报上展示的职位<span class="hb_jobchosebox_close" onclick='closeJob();'></span>
		</div>
		
		<div class="hb_jobchoselist_b">
			{yun:}foreach item=v from=$jobs key=key{/yun}
				<div class="hb_jobchoselist">
					<span class="hb_jobchose_input" id='jobid_{yun:}$v.id{/yun}'  onclick="ck('{yun:}$v.id{/yun}');">
						<input type="checkbox" id='job{yun:}$v.id{/yun}' name='jobname[]' value='{yun:}$v.id{/yun}' style='display:none;'/>
					</span>
					{yun:}$v.name{/yun}
				</div>
			{yun:}/foreach{/yun}
		</div>
		
		<div class="hb_jobchosebox_bth">
			<a href='javascript:void(0);' onclick="checkJob('jobname[]');" class="hb_jobchosebox_bth_a"> 生成海报</a>
		</div>
	</div>

	<div style="display:none; background:#000; opacity:0.6;width:100%;height:100%; position:fixed;left:0px;top:0px; z-index:1000000" id='bg'></div>
    
	<script type="text/javascript" src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.1.min.js?v={yun:}$config.cachecode{/yun}"></script>
 	<script src="{yun:}$wap_style{/yun}/js/public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
 	<script src="{yun:}$wap_style{/yun}/js/layer/layer.m.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
	<script>
		var uniReady = false;
		document.addEventListener('UniAppJSBridgeReady', function() {
			var uu = '{yun:}$smarty.get.uu{/yun}',
				token = '{yun:}$smarty.get.token{/yun}';
			if(uu.trim() !='' && token.trim() !=''){
				uniReady = true;
			}
		});
		
		$(document).ready(function() {
	       	'{yun:}if $smarty.get.a == hbshow {/yun}'
	       		$('#hb_a').show();
	       	'{yun:}/if{/yun}'
	 	});
		
		/* 选择职位样式改变 */
		function ck(id){
			var isCss     =	$('#jobid_'+id).hasClass('hb_jobchose_input_cur');
			if(isCss){
				$('#jobid_'+id).removeClass('hb_jobchose_input_cur');
				document.getElementById('job'+id).checked = false;
			}else{
				$('#jobid_'+id).addClass('hb_jobchose_input_cur');
				document.getElementById('job'+id).checked = true;
			}
 		}
		
		/* 职位选择弹出框 */
		function getHbJob(){
			$("#bg").css('display','block');
			$("#jobList").css('display','block');
		}
		
		function closeJob(){
			
			$("#bg").css('display','none');
			$("#jobList").css('display','none');
		}
		
		/* 职位选择检测 */
		function checkJob(name){
			
			var chk_value 	= 	[];
	        var i 			= 	0;
	        
	        $('input[name="' + name + '"]:checked').each(function() {
	            chk_value.push($(this).val());
	            i++;
	        });
	        
			if(chk_value.length == 0) {
	        	$('#hbtip').html('至少选择一份职位数据！');
 				$("#hbtip").fadeIn('slow',function(){
 					setTimeout(function(){
 						$("#hbtip").fadeOut('slow');
 					},2000);
 				});
	            return false;
	        } else if(chk_value.length > 3) {
	        	$('#hbtip').html('最多选择三份职位数据！');
 				$("#hbtip").fadeIn('slow',function(){
 					setTimeout(function(){
 						$("#hbtip").fadeOut('slow');
 					},2000);
 				});
	            return false;
	        } else {
	        	
 	           	$("#jobList").css('display','none');
 	           	
				if(uniReady){
					uni.redirectTo({
						url: '/pson/pages/haibao/show?id=4&jobids='+chk_value
					});
                }else{
					var id		=	'{yun:}$smarty.get.id{/yun}';
					var wapurl 	=	'{yun:}url m=wap{/yun}';
					window.location.href = wapurl+'/index.php?c=company&a=ws&id='+id+'&hb=4&jobids='+chk_value;
				}
 	        }
		}
		
   	</script>

</body>